package com.itheima.listener;

import com.itheima.config.RabbitMQConfig;
import com.itheima.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DeleteListener {

    @Autowired
    private ESManagerService esManagerService;

    /**
     * 监控播客增加
     */
    @RabbitListener(queues = RabbitMQConfig.DELETE_QUEUE)
    public void add(String uid){
        System.out.println("监控到被删除播客,uid为:"+uid);

        //调用删除方法12添加
        esManagerService.deleteElasticSearchByUid(uid);
    }
}
